<!--{template ADMIN_DIRECTORY/tpl/admin_header}-->
<div class="page_title" id="taskScroll">
    <h1>{$model_info['model_name']}{$_lang['manage']}</h1>
    <div class="tool">
        <a href="index.php?do=$do&model_id=$model_id&view=list">{$_lang['task_list']}</a>
        {loop $ops $v}
        <a href="index.php?do=$do&model_id={$model_id}&view=edit&task_id={$task_id}&op={$v}" class="{if $op==$v}here{/if}">{$_lang['b_task_'.$v]}</a>
        {/loop}
    </div>
</div>
<!--页头结束-->
<div class="box post">
    <div class="tabcon">
        <div class="title">
            <h2>{$_lang['b_task_'.$op]}</h2>
        </div>
        <div class="detail">
            <div id="ajax_dom">
            	{if $list}
                <table width="100%" border="0" cellpadding="5">
                    {loop $list $v}
                    <tbody id="w_{$v['work_id']}">
                        <tr>
                            <td width="110">
                                <a href="{$_K['siteurl']}/index.php?do=seller&id={$v['uid']}" target="_blank" title="{$v['username']}"><!--{userpic($v['uid'],'middle')}--></a>
                                <div class="t_c">
                                    <a href="{$_K['siteurl']}/index.php?do=seller&id={$v['uid']}" target="_blank">{$v['username']}</a>
                                </div>
                            </td>
                            <td style="padding:0">
                                <table border="0" cellpadding="0">
                                    <tr>
                                    	<td>
                                    		{$_lang['work_id']}{$_lang['zh_mh']}#<b>{$v['work_id']}</b>
                                    	</td>
                                        <td>
                                            {$_lang['work_status']}{$_lang['zh_mh']}
                                            <font color="red">
                                                <i>{$satus_arr[$v['work_status']]}</i>
                                            </font>
                                        </td>
                                        <td width="200">
                                            {$_lang['hand_time']}{$_lang['zh_mh']}<!--{date('Y-m-d H:i:s',$v['work_time'])}-->
                                        </td>
                                        <td align="center" width='170' style="border:1px solid black">
                                            <a href="{$_K['siteurl']}/index.php?do=task&id={$task_id}&view=work&work_id={$v['work_id']}#{$v['work_id']}" target="_blank" class='button'><span class="book icon"></span>{$_lang['work_view']}</a>
                                            {if in_array($v['work_status'],array(0,7,8))}<a href='javascript:void(0);' onclick="wdel('{$v[work_id]}');" class='button'><span class="icon trash">&nbsp;</span>{$_lang['work_delete']}</a>
                                            {/if}
                                        </td>
                                    </tr>
                                    <tr height='100'>
                                        <td colspan=3>
                                            <div class="ws_break" style="height:70px">
                                               <!--{eval echo htmlspecialchars_decode($v['work_desc'])}-->
                                            </div>
											<div id="c_{$v['work_id']}" style="display:none;width:80%;border-top:1px solid black"></div>
											<div id="f_{$v['work_id']}" style="display:none;width:80%;border-top:1px solid black"></div>
                                        </td>
                                        <td align="left" style="border:1px solid black">
                                            <ul>
                                                <li>
                                                    {$_lang['hide_work']}{$_lang['zh_mh']}
                                                    <font color="red">
                                                        {if $v['hide_work']!=1}
                                                        {$_lang['no']}
                                                        {else}
                                                        {$_lang['yes']}
                                                        {/if}
                                                    </font>
                                                </li>
                                                <li>
                                                    {$_lang['vote']}{$_lang['zh_mh']}{$v['vote_num']} {$_lang['piao']}
                                                </li>
                                                <li>
                                                    {$_lang['comment']}{$_lang['zh_mh']}
													{if $v['comment_num']}
														<a class="button" href="javascript:void(0);" onclick="loadComm('{$v[work_id]}');">
															<span class="loop icon"></span>{$_lang['load_comm']}($v['comment_num'])
														</a>
														{else}
															{$_lang['not_exists']}
														{/if}
                                                </li>
                                                <li>
                                                    {$_lang['ext_file']}{$_lang['zh_mh']}
													{if $v['work_file']}
													<!--{eval $c = explode(',',$v['work_file']);$n = count($c);}-->
													<a class="button" href="javascript:void(0)" onclick="loadFile('{$v[work_id]}');">
														<span class="loop icon"></span>{$_lang['load_file']}({$n})
													</a>
                                                    {else}{$_lang['not_exists']}
                                                    {/if}
                                                </li>
                                            </ul>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                    {/loop}
                    <tfoot>
                        <tr>
                            <td colspan="7">
                                <div class="page fl_right">
                                    {$pages['page']}
                                </div>
                            </td>
                        </tr>
                    </tfoot>
                </table>
				{else}
				<div class='t_c'>{$_lang['no_data']}</div>
				{/if}
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
	var url = '{$url}';
    function wdel(i){
    	art.dialog({
			title:"{$_lang['operate_notice']}",
			content:"{$_lang['are_you_sure']}",
			icon: 'succeed',
			yesFn:function(){
				$.getJSON(url,{ac:'del',work_id:i},function(json){
					if(json.status==1){
						$("#w_"+i).slideUp('slow').remove();
						art.dialog.tips("{$_lang['task_operate_successfully']}",1.5);
					}else{
						art.dialog.tips("{$_lang['task_operate_fail']}",1.5);
					}
				})
			},
			noFn:function(){this.close();return false;}
		})
    }
	function loadComm(i){
		var s = $.trim($('#c_'+i).html());
			if(!s){
				$('#c_'+i).load(url+'&ac=comm&work_id='+i).slideDown();
			}
	}
	function loadFile(i){
		var s = $.trim($('#f_'+i).html());
			if(!s){
				$('#f_'+i).load(url+'&ac=file&work_id='+i).slideDown();
			}
	}

</script>
<!--主体结束-->
<!--{template ADMIN_DIRECTORY/tpl/admin_footer}-->
